
#import "DataBase.h"
#import <AFNetworking.h>
#import <YYModel.h>
#import "MoviesModel.h"
#import "MiddleModel.h"




//为可变动的接口提供的宏定义
#define FreeData @""
#define ReportType @""
static DataBase *db = nil;
@interface DataBase ()
{
    NSDictionary *SumDict;
    MoviesModel *roadm;
    NSMutableDictionary *array;
    MiddleModel *cityMl;
}

@end


@implementation DataBase

+ (instancetype)shareData{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        db = [[DataBase alloc]init];
    });
    return db;
}

+ (instancetype)allocWithZone:(struct _NSZone *)zone
{
    if (!db)
    {
        db = [super allocWithZone:zone];
    }
    return db;
}

- (id)mutableCopy
{
    return self;
}

- (id)copy
{
    return self;
}

- (void)ShaiDq{
    SumDict = [[NSMutableDictionary alloc]init];
    array = [[NSMutableDictionary alloc]init];
    NSDictionary *parameters = @{@"screen_id":@1};
    AFHTTPSessionManager *mangers = [AFHTTPSessionManager manager];
    mangers.responseSerializer = [[AFHTTPResponseSerializer alloc]init];
    [mangers POST:[NSString stringWithFormat:@"%@%@",FreeData,ReportType] parameters:parameters progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        SumDict = [responseObject yy_modelToJSONObject];
        NSMutableArray *dataArr = [NSMutableArray array];
        dataArr = [SumDict objectForKey:@"data"];
        [[NSNotificationCenter defaultCenter]postNotificationName:@"huxiaobo" object:dataArr];
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {

    }];
}

@end
